Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: hide home dir in project.path and all paths in ape console #1931

Merged
merged 2 commits into from
May 7, 2024

Conversation

antazoey
Copy link
Member

What I did

  • project repr and str now hide the Home dir to be less doxy
  • ape console won't display any home dir for path's repr now -- all hidden

How I did it

  • make new clean path util
  • use it in project repr
  • customize the IPython integration to use it for showing paths:
    ipython.display_formatter.formatters["text/plain"].for_type(
        Path, lambda x, *args, **kwargs: rich_print(clean_path(x))
    )

How to verify it

Checklist

  • All changes are completed
  • New test cases have been added
  • Documentation has been updated

fubuloubu
fubuloubu previously approved these changes Feb 13, 2024
@fubuloubu
Copy link
Member

Need some hands on testing done

Copy link

This pull request is considered stale because it has been open 30 days with no activity. Remove stale label, add a comment, or make a new commit, otherwise this PR will be closed in 5 days.

@github-actions github-actions bot added the stale No activity for 30 days label Mar 15, 2024
@antazoey antazoey removed the stale No activity for 30 days label Mar 15, 2024
@antazoey antazoey marked this pull request as ready for review April 4, 2024 14:03
@antazoey
Copy link
Member Author

antazoey commented Apr 4, 2024

i guess saving this for 0.8 as it requires a 3.9 or greater feature from pathlib and i dont feel like making it compat

@NotPeopling2day NotPeopling2day changed the base branch from main to feat/08 April 22, 2024 16:31
@antazoey antazoey force-pushed the feat/08 branch 8 times, most recently from 61a3f89 to 2a0c7d5 Compare April 29, 2024 17:00
@antazoey antazoey force-pushed the feat/08 branch 4 times, most recently from 422b481 to 9987a48 Compare May 3, 2024 15:50
fubuloubu
fubuloubu previously approved these changes May 4, 2024
src/ape/utils/os.py Outdated Show resolved Hide resolved
@antazoey antazoey changed the base branch from feat/08 to main May 7, 2024 00:46
@antazoey antazoey dismissed fubuloubu’s stale review May 7, 2024 00:46

The base branch was changed.

@antazoey antazoey changed the base branch from main to feat/08 May 7, 2024 00:46
@antazoey antazoey merged commit 08cea7b into ApeWorX:feat/08 May 7, 2024
13 checks passed
@antazoey antazoey deleted the feat/anonpath branch May 7, 2024 01:36
antazoey added a commit to antazoey/ape that referenced this pull request May 9, 2024
antazoey added a commit to antazoey/ape that referenced this pull request May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants